#ifndef TITLE_H
#define TITLE_H

#include <QWidget>
#include<QPixmap>
#include <QMouseEvent>
namespace Ui {
class title;
}

class title : public QWidget
{
    Q_OBJECT
public:
    explicit title(QWidget *parent = nullptr);
    ~title();
protected:
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
private slots:
    void on_windowclose_clicked();
    void on_windowminormax_clicked();
    void on_windowmin_clicked();
signals:
    void myclose();    //关闭窗口信号
    void changewindow(bool flag);  //改变窗口大小信号
    void WindowMove(QPoint point);
    void Windowmin();
private:
    Ui::title *ui;
    QPixmap background;
    QPoint last;  //保存坐标点
    bool flag=true;
};

#endif // TITLE_H
